<%@page import="java.util.Vector"%>
<%@page import="connect.Login"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>register</title>
<script>
var w;
function getId(id){return document.getElementById(id);}
function zip(){
	w=window.open("./register/postsearch.jsp", "w", "height = 400, width = 530");
}
function idcheck(){		
	var id = myfrm.mid.value;
	 if( id==null || id.length<1){
	  alert("중복체크할 아이디를 입력하십시오");
	  
	 }else{	
	 var url = "./register/idCheck.jsp?id=" + id;
	 window.open(url, "get", "height = 160, width = 350");
	 }
}
function re(){
	myfrm.intro.value="";
	myfrm.intro.focus();
}
function NumObj(obj){
	  if (event.keyCode >= 48 && event.keyCode <= 57) { 
	  }else {
	   event.returnValue = false;
	   alert(" 숫자만 입력가능합니다.");
	  }
}
	

function com(){
	var p=myfrm.pwd.value;	//비번확인
	var p1=myfrm.pwd1.value;
	
	var str1=myfrm.careTxt.value; //기타 공백란
	
	
	if(p!=p1){alert("암호를 다시 한번 확인해주세요."); myfrm.pwd.focus();return;}
	else if(myfrm.mid.value==""){ alert("아이디를 입력해주세요."); myfrm.mid.focus();return;}
	else if(myfrm.pwd.value=="") {alert("암호를 입력해주세요."); myfrm.pwd.focus(); return;}
	else if(myfrm.pwd1.value=="") {alert("암호확인란을 입력해주세요.");myfrm.pwd1.focus();return;}
	else if(myfrm.irum.value=="") {alert("이름을 입력해주세요.");myfrm.irum.focus();return;}
	else if(myfrm.birth.value=="") {alert("생년월일을 입력해주세요.");myfrm.birth.focus();return;}
	else if(myfrm.gender.value=="") {alert("성별을 선택해주세요.");return;}
	else if(myfrm.addr1.value=="") {alert("주소를 입력해주세요.");return;}
	else if(myfrm.addr2.value=="") {alert("주소를 입력해주세요.");return;}
	else if(myfrm.pnum1.value=="" || myfrm.pnum1.value=="-") {alert("휴대폰번호를 선택해주세요.");return;}
	else if(myfrm.pnum2.value=="") {alert("휴대폰번호를 입력해주세요.");myfrm.pnum2.focus();return;}
	else if(myfrm.pnum3.value=="") {alert("휴대폰번호를 입력해주세요.");myfrm.pnum3.focus();	return;}
	else if(!myfrm.care1.checked && !myfrm.care2.checked && !myfrm.care3.checked
			 && !myfrm.care4.checked && !myfrm.care5.checked && !myfrm.care6.checked
			 && !myfrm.care7.checked && !myfrm.care8.checked && !myfrm.care9.checked
			  && str1==""){
		alert("취미를 선택해주세요"); return;}
	else if(myfrm.email1.value=="") {alert("이메일을 입력해주세요.");myfrm.email1.focus();return;}
	else if(myfrm.email2.value==""){ alert("이메일을 입력해주세요.");return;}
	else if(myfrm.intro.value=="") {alert("자기소개를 입력해주세요.");myfrm.intro.focus();return;}
	
		
	myfrm.action="index.jsp?inc_contents=./register/register3.jsp";
	myfrm.submit();
	
}

</script>	
<style>
#main1{
width:1000px;
margin:0 auto;
padding-bottom: 50px;
}
#main2{
width:750px;
margin:auto;
margin-top:2px;

padding:5px;

}
#line{
border:1px solid #BDBDBD;
height: 30px;

}
#left{
border:1px solid #BDBDBD;
width:100px;
height: 30px;
text-align: center;
background-color: #A9D0F5;
}
#con{
border:1px solid #BDBDBD;
width:650px;
height:30px;
position:relative;
left:100px;
top:-32px;
background-color: #CEE3F6;
}
#ad{
border:1px solid #BDBDBD;
height: 60px;
}
#adleft{
border:1px solid #BDBDBD;
width:100px;
height: 60px;
text-align: center;
background-color: #A9D0F5;
}
#adcon{
border:1px solid #BDBDBD;
width:650px;
height:60px;
position:relative;
left:100px;
top:-62px;
background-color: #CEE3F6;
}
#myin{
border:1px solid #BDBDBD;
height: 200px;
}
#myinleft{
border:1px solid #BDBDBD;
width:100px;
height: 200px;
text-align: center;
background-color: #A9D0F5;
}
#myincon{
border:1px solid #BDBDBD;
width:650px;
height:200px;
position:relative;
left:100px;
top:-202px;
background-color: #CEE3F6;
}
#topg{
background-color: #faa719;
text-align: center;
font-size: 17px;
font-weight:bold;
margin-top: 10px;
padding: 10px;
border:2px solid #faa719;
width:729px;
}
#complete1,#cancel{
	width:60px;
	height:30px;	
	background-color: #faa719;
	font-family: 'Nanum Gothic', sans-serif;
	font-size:12px;
	color:#000000;	
	border:1px solid #faa719;
	border-top-right-radius:5px;
	border-bottom-right-radius:5px;
	border-top-left-radius:5px;
	border-bottom-left-radius:5px;
	box-shadow:4px 3px 6px #dddddd;
}
</style>


</head>
<body>


<form name="myfrm" method="POST" action="">
<div id='main1'>
<div id='main2'>
	<div id='topg'>1.가입약관 <font size=5><b>2.개인정보</b></font> 3.가입완료</div>
	
	<div id='line'>
		<div id='left'>아이디	</div>
		<div id='con'>			
				<INPUT TYPE="text" NAME="mid" id='mid' title="이름을 입력해주세요!">
			<input type="button" value="중복확인" onclick='idcheck()'>			
		</div>
	</div>
	
	<div id='line'>
		<div id='left'>암호</div>
		<div id='con'>
			<INPUT TYPE="password" NAME="pwd" id="pwd">
		</div>
	</div>
	
	<div id='line'>
		<div id='left'>암호확인</div>
		<div id='con'>
			<INPUT TYPE="password" NAME="pwd1" id="pwd1">
		</div>
	</div>
	<div id='line'>
		<div id='left'>이름</div>
		<div id='con'>
			<INPUT TYPE="text" NAME="irum" id="irum">
		</div>
	</div>	
	<div id='line'>
		<div id='left'>생년월일</div>
		<div id='con'>
			<INPUT TYPE="text" NAME="birth" id="birth" maxlength="6"  
			onkeyPress ="NumObj(this)"> <font size="2">예 ) 891120</font>
		</div>
	</div>	
	
	<div id='line'>
		<div id='left'>성별</div>
		<div id='con'>
			<input type="radio" name="gender" id='gender' value="남자">남자
			<input type="radio" name="gender" id='gender' value="여자">여자
		</div>
	</div>
	<div id='ad' >
		<div id='adleft'><br/>주소</div>
		<div id='adcon'>
			<INPUT TYPE="text" NAME="addr1" id="addr1" readonly>
			<input type="button" value="주소찾기" onclick="zip()"> <font size="2">주소찾기 버튼을 눌러주세요</font><br>
			<INPUT TYPE="text" NAME="addr2" id="addr2" size="66px">			

		</div>	
	</div>
	<div id='line'>
		<div id='left'>휴대폰</div>
		<div id='con'>
			<SELECT NAME="pnum1"  id="pnum1" onchange="msg(this)">
					<option value="-">-선택하세요-
					<option value="010">010
					<option value="011">011
					<option value="017">017
					<option value="016">016
					<option value="018">018
					<option value="019">019
					</SELECT>
					<INPUT TYPE="text" NAME="pnum2" id="pnum2" maxlength="4">
					-
					<INPUT TYPE="text" NAME="pnum3" id="pnum3" maxlength="4">
		</div>	
	</div>
	<div id='line'>
		<div id='left'>전화</div>
		<div id='con'>
			<SELECT NAME="num1" id="num1" onchange="msg(this)">
					<option value="-">-선택하세요-
					<option value="02">(서울)02
					<option value="031">(경기)031
					<option value="032">(인천)032
					<option value="033">(강원)033
					<option value="041">(충남)041
					<option value="042">(대전)042
					<option value="043">(충북)043
					<option value="051">(부산)051
					<option value="052">(울산)052
					<option value="053">(대구)053
					<option value="054">(경북)054
					<option value="055">(경남)055
					<option value="061">(전남)061
					<option value="062">(광주)062
					<option value="063">(전북)063
					<option value="064">(제주)064
					</SELECT>
					<INPUT TYPE="text" NAME="num2" id="num2" maxlength="4">
					-
					<INPUT TYPE="text" NAME="num3" id="num3" maxlength="4">
		</div>	
	</div>
	<div id='line'>
		<div id='left'>이메일</div>
		<div id='con'>
			<INPUT TYPE="text" NAME="email1" id="email1"> @
					
					<label>
					<input name='email2' type='text' list='emaillist'> <font size="2">선택 가능합니다</font>
					</label>
					<datalist id='emaillist'>
					<option value="google.com" label="Google">
					<option value="naver.com" label="네이버">
					<option value="nate.com" label="네이트">
					<option value="daum.net" label="다음">
					</datalist>
		</div>	
	</div>
	<div id='ad'>
		<div id='adleft'><br/>취미</div>
		<div id='adcon'>
			<label><input type="checkbox" name="care1"  value="쇼핑 ">쇼핑</label>
			<label><input type="checkbox" name="care2"  value="게임 ">게임</label>
			<label><input type="checkbox" name="care3"  value="컴퓨터 ">컴퓨터</label>
			<label><input type="checkbox" name="care4"  value="낚시 ">낚시</label>
			<label><input type="checkbox" name="care5"  value="공부 ">공부</label>
			<label><input type="checkbox" name="care6"  value="독서 ">독서</label>
			<label><input type="checkbox" name="care7"  value="등산 ">등산</label><br/>
			<label><input type="checkbox" name="care8"  value="운동 ">운동</label>
			<label><input type="checkbox" name="care9"  value="뉴스보기 ">뉴스보기</label>
			
			<label>&nbsp;&nbsp; 기타 <INPUT TYPE="text" NAME="careTxt" value=""></label>
		</div>
	</div>
	<div id='myin'>
		<div id='myinleft'><br/><br/><br/><br/><br/>자기소개</div>
		<div id='myincon'>
			<TEXTAREA NAME="intro" id="intro" ROWS="12" COLS="77" style="resize:none;"></TEXTAREA>
			<input type="button" value="다시쓰기" onclick="re()">
		</div>
	</div>
	<div align='center'><br/>
		<input type="button" value='작성완료' id='complete1' onclick='com()'></a>
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<a href="./index.jsp"><input type='button' value='취소하기' id='cancel'></a>
	</div>		

</div>

</div>
</form>
</body>
</html>